{extend name='admin@main'}

{block name="button"}
{if auth("meetyou/level/add")}
<button data-modal='{:url("add")}' data-title="添加等级" class='layui-btn layui-btn-sm layui-btn-primary'>添加等级</button>
{/if}
{/block}

{block name="content"}
<div class="think-box-shadow">

    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='text-left nowrap'>等级</th>
            <th class='text-left nowrap'>等级名称</th>
            <th class='text-left nowrap'>升级条件</th>
            <th class='text-left nowrap'>预约次数</th>
            <th class='text-left nowrap'>操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr>
            <td class='text-left'>{$vo.level}</td>
            <td class='text-left'>{$vo.levelname}</td>

            <td class='text-left'>
                {notempty name='vo.discount'}
                直推:{$vo.discount}会员
                {else}
                无升级条件
                {/notempty}
            </td>

            <td class='text-left'>
                {notempty name='vo.rescount'}
                {$vo.rescount}/天
                {else}
                系统默认
                {/notempty}
            </td>

            <td class='text-left nowrap'>
                {if auth("meetyou/level/edit")}
                <a data-dbclick data-title="编辑" class="layui-btn layui-btn-xs" data-modal='{:url("edit")}?id={$vo.id}'>编 辑</a>
                {/if}

                {if auth("meetyou/level/remove")}
                <a class="layui-btn layui-btn-xs layui-btn-danger" data-confirm="确定要删除该等级吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>
                {/if}
            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
</div>
{/block}
